package com.education.platform.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 教员回复需求表
 *
 * @author education-platform
 * @since 2024-09-27
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("demand_reply")
@JsonIgnoreProperties(value = {"handler"})
public class DemandReply {

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 需求ID
     */
    @TableField("demand_id")
    private Long demandId;

    /**
     * 教员ID
     */
    @TableField("teacher_id")
    private Long teacherId;

    /**
     * 回复内容
     */
    @TableField("message")
    private String message;

    /**
     * 报价
     */
    @TableField("price_offer")
    private BigDecimal priceOffer;

    /**
     * 联系方式
     */
    @TableField("contact_info")
    private String contactInfo;

    /**
     * 状态
     */
    @TableField("status")
    private String status;

    /**
     * 创建时间
     */
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    /**
     * 更新时间
     */
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;

    // 关联对象（用于XML映射）
    @TableField(exist = false)
    private User teacher;
    
    @TableField(exist = false)
    private UserProfile teacherProfile;

    // 枚举定义
    public enum Status {
        SENT("已发送"),
        READ("已阅读"),
        ACCEPTED("已接受"),
        REJECTED("已拒绝");

        private final String description;

        Status(String description) {
            this.description = description;
        }

        public String getDescription() {
            return description;
        }
    }
} 